package com.huilian.iotbox.data.enums;

import lombok.Getter;

@Getter
public enum CommodityTypeEnum {
    REGULAR(1, "游戏币/弹珠套餐（设备专用）"),
    CURRENT(2, "通用（收银专用）"),
    PACKAGE(3, "套票（收银专用）"),
    RECHARGE_BALANCE(4, "余额储值套餐（收银专用）"),
    VENDING_MACHINE(5, "售货机类型"),
    CAMERA(6, "拍照机套餐（设备专用）"),
    GAME_COINS_OR_MARBLES_PACKAGE_CASHIER_ONLY(7, "游戏币/弹珠套餐（收银专用）"),
    BALANCE_STORED_VALUE_PACKAGE_DEVICE_ONLY(8, "余额储值套餐（设备专用）"),
    ;

    private Integer code;
    private String desc;

    CommodityTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static Integer getCommodityGroupTypeCode(Integer code){
        for (CommodityTypeEnum value : CommodityTypeEnum.values()) {
            if (value.getCode().equals(code)){
                return code;
            }
        }
        return null;
    }
}
